import type { AxiosRequestConfig, AxiosResponse } from 'axios';
// 为了让不同的实例有不同的响应拦截处理
export interface RequestInterceptors<T = AxiosResponse> {
  requestInterceptor?: (config: AxiosRequestConfig) => AxiosRequestConfig;
  requestInterceptorCatch?: (error: any) => any;
  responseInterceptor?: (res: T) => T;
  responseInterceptorCatch?: (error: any) => any;
}
export interface RequestConfig<T = AxiosResponse> extends AxiosRequestConfig {
  interceptors?: RequestInterceptors<T>; //扩展interceptors写法,这里写泛型传入接口RequestInterceptors
  showLoading?: boolean;
}
